package com.woniu.project.client;

import com.woniu.project.core.dto.ResultDto;
import com.woniu.project.dto.productentitydto.ProductEntityOneDto;
import com.woniu.project.params.productentityparams.ProductEntityConditionParams;
import com.woniu.project.params.productentityparams.ProductEntityParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "assess-server" /*,configuration = FeignConfig.class*/)
public interface ProductEntityCient {

    /**
     * 查询商品实体列表
     * @param productEntityConditionParams
     * @return
     */
    @GetMapping("/pawn/assess/product-entity/selectProductEntityList")
    public ResultDto selectProductEntityList(ProductEntityConditionParams productEntityConditionParams);

    /**
     * 根据id查询单个商品详细信息
     * @param productEntityId productEntityId商品实体id
     * @return
     */
    @GetMapping("/pawn/assess/product-entity/selectOneProductEntity/{productEntityId}")
    public ResultDto selectOneProductEntity(@PathVariable("productEntityId") Integer productEntityId);

    /**
     * 新增/修改商品实体
     * @param productEntityParams productEntityParams商品实体对象
     * @return
     */
    @PostMapping("/pawn/assess/product-entity/updateProductEntity")
    public ResultDto updateProductEntity(@RequestBody ProductEntityParams productEntityParams);

    /**
     * 根据商品实体id删除商品
     * @param productEntityId 商品实体id
     * @return
     */
    @GetMapping("/pawn/assess/product-entity/deleteProductEntity/{productEntityId}")
    public ResultDto deleteProductEntity(@PathVariable("productEntityId") Integer productEntityId);

    /**
     * 根据大商品类别id查询商品
     * @param bigTypeId 大类id
     * @return
     */
    @GetMapping("/pawn/assess/product-entity/selectByBigTypeId/{bigTypeId}")
    public ResultDto selectByBigTypeId(@PathVariable("bigTypeId") Integer bigTypeId);

    /**
     * 根据小商品类别id查询商品
     * @param smallTypeId 小类别
     * @return
     */
    @GetMapping("/pawn/assess/product-entity/selectBySmallTypeId/{smallTypeId}")
    public ResultDto selectBySmallTypeId(@PathVariable("smallTypeId") Integer smallTypeId);

    /**
     * 根据商品id查询商品实体
     * @param productId 商品id
     * @return
     */
    @GetMapping("/pawn/assess/product-entity/selectByProductId/{productId}")
    public ResultDto selectByProductId(@PathVariable("productId") Integer productId);

    /**
     * 根据商品品牌查询商品实体
     * @param brandId 品牌id
     * @return
     */
    @GetMapping("/pawn/assess/product-entity/selectByBrandId/{brandId}")
    public ResultDto selectByBrandId(@PathVariable("brandId") Integer brandId);

    /**
     * 根据商品属性id查询商品实体
     * @param propertyId 商品属性id
     * @return
     */
    @GetMapping("/pawn/assess/product-entity/selectByPropertyId/{propertyId}")
    public ResultDto selectByPropertyId(@PathVariable("propertyId") Integer propertyId);


}
